package com.sunmnet.j2se.powerdb.autocode;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.io.File;
import java.util.Iterator;

/**
 * <PRE>
 * 启动类
 * </PRE>
 * <B>项    目：</B>J2EE开发平台
 * <B>技术支持：</B>三盟科技 (c) 2016
 *
 * @author 黄坚：huangjian@sunmnet.com
 * @version 1.0 2016/7/23
 * @since jdk版本：jdk1.7
 */
public class Main {

	public static void main(String[] args) {
		System.out.println("success");

		System.out.println(System.getProperty("user.dir"));
		readXML();

	}

	private static void readXML() {
		SAXReader saxReader=new SAXReader();
		Document document = null;

		File file = new File("D:" + File.separator + "workspaces\\04_sunmnet-project\\04_sunmnet-power-db\\power-db-auto-code\\conf\\conf.xml");
		System.out.println(file.getAbsoluteFile());
		try {
			document = saxReader.read(file);
		} catch (DocumentException e) {
			e.printStackTrace();
		}
		Element rootElement;
		rootElement = document.getRootElement();
		Iterator<Element> iter = rootElement.elementIterator();
		while (iter.hasNext()) {
			Element e = iter.next();
			System.out.println("配置文件custom: " + e.getText());
		}


	}
}
